<?php

$email = $_POST["email"];
$userID= $_POST["userID"];
if($email != "" && $userID != "")
	connect_database();

function connect_database(){
		$mysqli = new mysqli('localhost', 'root', '', 'gluphien');
		//echo $DBConnect;
		if ($mysqli->connect_errno)
			echo "<p>Connection Failed.</p>";
		$SQLstring = "UPDATE `userdetails` SET email='" . $GLOBALS["email"] . "' WHERE userID='" . $GLOBALS["userID"] . "'";
		if (mysqli_query($mysqli, $SQLstring) === TRUE) {
			echo "Successfully changed email";
		}
		else
		{
			echo $mysqli->error();
		}
		$mysqli->close();
	}
?>